package com.github.boluo1230.wechat.feign;

import com.github.boluo1230.wechat.entity.WxUser;
import com.github.boluo1230.wechat.feign.fallback.WxAPIFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author Code Farmer
 * @date 2019/10/14 16:08
 */
@FeignClient(url = "https://api.weixin.qq.com/sns/",
        value = "weixin-api",
        fallbackFactory = WxAPIFallback.class)
public interface WxAPI {
    /**
     * 获取用户基本信息
     */
    @GetMapping("/cgi-bin/message/custom/send")
    WxUser getWxUser(@RequestParam(value = "access_token") String accessToken,
                     @RequestParam(value = "openid") String openId);

}
